package com.test.p02simplefactory.example01;

/**
 * @author bcc
 */
public class Main {
    public static void main(String[] args) {
        try{
            Fruit grape = FruitGardener.factory("grape");
            grape.plant();
            grape.grow();
            grape.harvest();

            Fruit apple = FruitGardener.factory("apple");
            apple.plant();
            apple.grow();
            apple.harvest();
            Fruit strawberry = FruitGardener.factory("strawberry");
            strawberry.plant();
            strawberry.grow();
            strawberry.harvest();

            Fruit sss = FruitGardener.factory("sss");
            sss.plant();
            sss.grow();
            sss.harvest();
        }catch (BadFruitException e){
            System.out.println(e.getMessage());
        }
    }
}
